/*
 * @lc app=leetcode.cn id=70 lang=typescript
 *
 * [70] 爬楼梯
 */

// @lc code=start
function climbStairs(n: number): number {
    let save = [1, 2];
    for (let index = 2; index < n; index++) {
        save.push(save[index - 2] + save[index - 1]);
    }
    return save[n - 1];
}

// @lc code=end
